<template>
    <el-menu :default-active="deActiive" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b" class="el-menu-vertical-demo aaa"
    :collapse="isCollapse" router>
    <el-menu-item index="/index/home">
        <i class="el-icon-setting"></i>
        <span slot="title">主页</span>
    </el-menu-item>
    <el-submenu index="person">
        <template slot="title">
            <i class="el-icon-message"></i>
            <span slot="title">用户管理</span>
        </template>
        <el-menu-item index="/index/find-user">查看用户</el-menu-item>
    </el-submenu>
    <el-submenu index="courses">
        <template slot="title">
            <i class="el-icon-message"></i>
            <span slot="title">商品管理</span>
        </template>
        <el-menu-item index="/index/find-commodity">查看商品</el-menu-item>
        <el-menu-item index="/index/find-classification">查看商品分类</el-menu-item>
        <el-menu-item index="/index/add-commodity">添加商品信息</el-menu-item>
        <el-menu-item index="/index/add-classification">添加商品分类</el-menu-item>
    </el-submenu>
    <el-submenu index="teacher">
        <template slot="title">
            <i class="el-icon-message"></i>
            <span slot="title">公司管理</span>
        </template>
        <el-menu-item index="/index/find-dept">查看团队</el-menu-item>
        <el-menu-item index="/index/find-order">查看订单</el-menu-item>
        <el-menu-item index="/index/add-dept">添加团队</el-menu-item>
        <el-menu-item index="/index/find-team-user">员工管理</el-menu-item>
    </el-submenu>
    <!-- <el-menu-item index="1-1">支付记录</el-menu-item> -->
    <el-submenu index="pay">
        <template slot="title">
            <i class="el-icon-message"></i>
            <span slot="title">支付管理</span>
        </template>
        <el-menu-item index="find-refund-order">
            退款处理
            <el-badge v-if="orderCount !== 0" :value="orderCount" class="item"></el-badge>
        </el-menu-item>
    </el-submenu>
</el-menu>
</template>

<script>
export default {
  props: ["isCollapse"],
  created() {
    commodityHttp.get_refund_order_count().then(data => {
      if (data.data.success) return;
      this.orderCount = data.data.count;
    });
  },
  computed: {
    deActiive() {
      return this.$route.path;
    }
  }
};
</script>

<style lang="scss">
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 120vh;
}

.aaa {
  min-height: 120vh;
}
</style>


